package com.example.zhinongbao.Fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;

import com.example.zhinongbao.R;

public class MyProductsFragment extends Fragment {
    private static final String ARG_TYPE = "type";
    private RecyclerView recyclerView;

    public MyProductsFragment(String type) {
        Bundle args = new Bundle();
        args.putString(ARG_TYPE, type);
        setArguments(args);
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my_products, container, false);

        // 根据类型初始化不同的数据
        String type = getArguments().getString(ARG_TYPE);
        setupRecyclerView(type);

        return view;
    }

    private void setupRecyclerView(String type) {
        // 根据货品类型设置不同的适配器和数据
        // 这里可以使用原来的RecyclerView逻辑
    }
}